package com.unitedvision.core.domain;

public class CompanyBill {
	private int id;
	private Company company;
	private Periode periode;
	private long bill;
	private long billPaid;
	private CompanyBillingStatus billingStatus;
	
	public CompanyBill() {
		super();
	}

	public CompanyBill(int id, Company company, Periode periode, long bill, long billPaid, CompanyBillingStatus billingStatus) {
		super();
		this.id = id;
		this.company = company;
		this.periode = periode;
		this.bill = bill;
		this.billPaid = billPaid;
		this.billingStatus = billingStatus;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	public Periode getPeriode() {
		return periode;
	}

	public void setPeriode(Periode periode) {
		this.periode = periode;
	}

	public long getBill() {
		return bill;
	}

	public void setBill(long bill) {
		this.bill = bill;
	}

	public long getBillPaid() {
		return billPaid;
	}

	public void setBillPaid(long billPaid) {
		this.billPaid = billPaid;
	}

	public CompanyBillingStatus getBillingStatus() {
		return billingStatus;
	}

	public void setBillingStatus(CompanyBillingStatus billingStatus) {
		this.billingStatus = billingStatus;
	}

	public String getName() {
		return company.getName();
	}

	public Address getAddress() {
		return company.getAddress();
	}

	public Contact getContact() {
		return company.getContact();
	}

	@Override
	public String toString() {
		return "CompanyBill [id=" + id + ", company=" + company + ", periode="
				+ periode + ", bill=" + bill + ", billPaid=" + billPaid
				+ ", billingStatus=" + billingStatus + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (bill ^ (bill >>> 32));
		result = prime * result + (int) (billPaid ^ (billPaid >>> 32));
		result = prime * result
				+ ((billingStatus == null) ? 0 : billingStatus.hashCode());
		result = prime * result + ((company == null) ? 0 : company.hashCode());
		result = prime * result + id;
		result = prime * result + ((periode == null) ? 0 : periode.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CompanyBill other = (CompanyBill) obj;
		if (bill != other.bill)
			return false;
		if (billPaid != other.billPaid)
			return false;
		if (billingStatus != other.billingStatus)
			return false;
		if (company == null) {
			if (other.company != null)
				return false;
		} else if (!company.equals(other.company))
			return false;
		if (id != other.id)
			return false;
		if (periode == null) {
			if (other.periode != null)
				return false;
		} else if (!periode.equals(other.periode))
			return false;
		return true;
	}
}
